package cn.stylefeng.guns.modular.rest;

import cn.stylefeng.guns.modular.school.entity.ClassInfo;
import cn.stylefeng.guns.modular.school.service.ClassInfoService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/miniprogramApi/class")
public class ApiClassInfoController extends BaseController {

    @Autowired
    private ClassInfoService classInfoService;

    @RequestMapping(value = "list")
    public Object list() {
        Map map = new HashMap();
        List<ClassInfo> list = classInfoService.list();

        map.put("class", list);

        SUCCESS_TIP.setData(map);
        return SUCCESS_TIP;
    }

}


